//
//  ImportantAreaViewController.m
//  Utils
//
//  Created by enghou on 2018/6/13.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "ImportantAreaViewController.h"
#import "ImportantAreaItemModel.h"
#import "ImportantAreaDetailViewController.h"
@interface ImportantAreaViewController ()

@end

@implementation ImportantAreaViewController

-(instancetype)init{
    self = [super init];
    if (self) {
        self.path = @"/mobile/comprehensiveGovernance/importantArea/getImportantAreaList.action";
        self.modelClsName = @"ImportantAreaItemModel";
        self.cellClass = @"ImportantAreaCell";
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(beginRefresh) name:@"refresh_important_area" object:nil];
}

-(void)addAction{
    ImportantAreaDetailViewController *detail = [[ImportantAreaDetailViewController alloc]init];
    detail.title = @"重点区域";
    [self push:detail];
}

#pragma mark - Table view data source
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 142;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    ImportantAreaItemModel *model = self.source[indexPath.row];
    ImportantAreaDetailViewController *detail = [[ImportantAreaDetailViewController alloc]init];
    detail.ids = model.ID;
    detail.title = @"重点区域详情";
    [self push:detail];
}

@end
